// pages/video/video.js
import request from '../../utils/request.js'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    videoGroupList:[],
    navId:'',
    videoList:[],
    videoId:'',
    videoUpdateTime:[],
    isTrigger:false
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getVideoGroupList()
   
  },
  async getVideoGroupList(){
    let res=await request('/video/group/list')
    this.setData({
      videoGroupList:res.data.slice(0,14),
      navId: res.data[0].id
    })
    // 获取列表数据后在获取对应navId
    this.getvideoList(this.data.navId)
  },
  changeNav(e){
    let navId=e.currentTarget.id
    this.setData({
      navId,
      videoList: []
    })
    wx.showLoading({
      title: '正在加载',
    })

    this.getvideoList(this.data.navId)
  },

  async getvideoList(navId){
    if(!navId){
      return
    }
    let res2=await request('/video/group',{id:navId})
    wx.hideLoading()
    let index=0
    let videoList = res2.datas.map(item=>{
      item.id=index++
      return item
    })
    this.setData({
      videoList,
      isTrigger:false
    })
  },

  handlePlay(e){
    // console.log('1')
    let vid=e.currentTarget.id
    // this.vid!==vid&&this.videoContext&&this.videoContext.stop()
    // this.vid=vid
    this.setData({
      videoId:vid
    })
    this.videoContext=wx.createVideoContext(vid)
    let {videoUpdateTime}=this.data
    let videoItem=videoUpdateTime.find(item=>item.vid===vid)
    if(videoItem){
      this.videoContext.seek(videoItem.currentTime)
    }
    this.videoContext.play()
  },

  handleTime(e){
    let videoTimeObj={vid:e.currentTarget.id,currentTime:e.detail.currentTime}
    let { videoUpdateTime}=this.data
    
    let videoItem=videoUpdateTime.find(item=>item.vid==videoTimeObj.vid)
    if(videoItem){
      videoItem.currentTime = e.detail.currentTime
    }else{
      videoUpdateTime.push(videoTimeObj)
    }
    this.setData({
      videoUpdateTime
    })
  },

  handleEnd(e){
    let {videoUpdateTime}=this.data
    
    videoUpdateTime.splice(videoUpdateTime.findIndex(item => item.vid === e.currentTarget.id),1)
    this.setData({
      videoUpdateTime
    })
  },

  handleRefresher(){
    this.getvideoList(this.data.navId)
  },

  handleToLower(){
    let newVideoList = [
      {
        "type": 1,
        "displayed": false,
        "alg": "onlineHotGroup",
        "extAlg": null,
        "data": {
          "alg": "onlineHotGroup",
          "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
          "threadId": "R_VI_62_9A8B40A9186DE952527CC506D0C3A4A3",
          "coverUrl": "https://p1.music.126.net/eqZpoNIW83jzJqSNoYr19w==/109951163905804175.jpg",
          "height": 360,
          "width": 626,
          "title": "Blackpink美国出道首秀，《Forever Young》现场",
          "description": "韩国实力女团Blackpink在连续取得耀眼的成绩之后昂首踏入国际化的道路，恭喜四位妹妹在美国出道，来看看《Forever young》的现场吧，粉丝们的欢呼声太太太太强烈啦！",
          "commentCount": 642,
          "shareCount": 636,
          "resolutions": [
            {
              "resolution": 240,
              "size": 46956292
            }
          ],
          "creator": {
            "defaultAvatar": false,
            "province": 110000,
            "authStatus": 1,
            "followed": false,
            "avatarUrl": "http://p1.music.126.net/w9sQfaK_Xissw1pmu9LcXw==/109951163536090163.jpg",
            "accountStatus": 0,
            "gender": 2,
            "city": 110101,
            "birthday": -2209017600000,
            "userId": 1539973165,
            "userType": 10,
            "nickname": "在云村看现场",
            "signature": "网易云音乐是6亿人都在使用的音乐平台，致力于帮助音乐爱好者发现音乐惊喜，帮助音乐人实现梦想。\n在云村看现场独家策划专题每周周末更新，欢迎各位村民私信或者@优质音乐现场内容！\n如果仍然不能解决您的问题，请邮件我们：\n用户：ncm5990@163.com\n音乐人：yyr599@163.com",
            "description": "在云村看现场官方",
            "detailDescription": "在云村看现场官方",
            "avatarImgId": 109951163536090160,
            "backgroundImgId": 109951162868126480,
            "backgroundUrl": "http://p1.music.126.net/_f8R60U9mZ42sSNvdPn2sQ==/109951162868126486.jpg",
            "authority": 0,
            "mutual": false,
            "expertTags": null,
            "experts": null,
            "djStatus": 0,
            "vipType": 0,
            "remarkName": null,
            "backgroundImgIdStr": "109951162868126486",
            "avatarImgIdStr": "109951163536090163"
          },
          "urlInfo": {
            "id": "9A8B40A9186DE952527CC506D0C3A4A3",
            "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/T3WUvxct_2355908941_sd.mp4?ts=1636387077&rid=02648776A9D33D70D040C82E128F8F4B&rl=3&rs=oZiLQFWLsFqlyMMIuldodrpvKFkSUoxI&sign=a59c22ed80931c2ea48bc24fdc97a20a&ext=YfDbJSkjRHA1vAgh%2BD0WNwV2JWebj2KtExWltRZNHp6u%2FJB2BcS75ZKGSWm4JwjuGpIgDhLXzFElSj2Mn3dxUcwifrlKrWEEkajI1O6JrLD%2BpvV%2B6sXVz7E9w5%2F0ueoCLvWJjXPhxfYPtO1x7zJFMf3jQr%2FiT0K6Ty4SvoY5wjmTTuRBCqLB7hFDedPKU8LtUSsoQXUJFw0n%2BbJeCkN6sh%2B6g7TfMXuZBpGVwu6Lygp5GIh%2FEY%2Bi%2BmB2mJOcHsar",
            "size": 46956292,
            "validityTime": 1200,
            "needPay": false,
            "payInfo": null,
            "r": 240
          },
          "videoGroup": [
            {
              "id": 58100,
              "name": "现场",
              "alg": null
            },
            {
              "id": 9102,
              "name": "演唱会",
              "alg": null
            },
            {
              "id": 57107,
              "name": "韩语现场",
              "alg": null
            },
            {
              "id": 57108,
              "name": "流行现场",
              "alg": null
            },
            {
              "id": 1100,
              "name": "音乐现场",
              "alg": null
            },
            {
              "id": 5100,
              "name": "音乐",
              "alg": null
            }
          ],
          "previewUrl": null,
          "previewDurationms": 0,
          "hasRelatedGameAd": false,
          "markTypes": null,
          "relateSong": [
            {
              "name": "FOREVER YOUNG",
              "id": 1325897389,
              "pst": 0,
              "t": 0,
              "ar": [
                {
                  "id": 12068017,
                  "name": "BLACKPINK",
                  "tns": [],
                  "alias": []
                }
              ],
              "alia": [],
              "pop": 100,
              "st": 0,
              "rt": null,
              "fee": 8,
              "v": 6,
              "crbt": null,
              "cf": "",
              "al": {
                "id": 74266151,
                "name": "BLACKPINK IN YOUR AREA",
                "picUrl": "http://p3.music.126.net/yKysEblB7-HOVrUCjvRhqw==/109951163678530141.jpg",
                "tns": [],
                "pic_str": "109951163678530141",
                "pic": 109951163678530140
              },
              "dt": 237146,
              "h": {
                "br": 320000,
                "fid": 0,
                "size": 9488762,
                "vd": -53700
              },
              "m": {
                "br": 192000,
                "fid": 0,
                "size": 5693275,
                "vd": -51400
              },
              "l": {
                "br": 128000,
                "fid": 0,
                "size": 3795531,
                "vd": -49600
              },
              "a": null,
              "cd": "1",
              "no": 7,
              "rtUrl": null,
              "ftype": 0,
              "rtUrls": [],
              "djId": 0,
              "copyright": 0,
              "s_id": 0,
              "rtype": 0,
              "rurl": null,
              "mst": 9,
              "cp": 457010,
              "mv": 0,
              "publishTime": 1542902400000,
              "privilege": {
                "id": 1325897389,
                "fee": 8,
                "payed": 0,
                "st": 0,
                "pl": 128000,
                "dl": 0,
                "sp": 7,
                "cp": 1,
                "subp": 1,
                "cs": false,
                "maxbr": 999000,
                "fl": 128000,
                "toast": false,
                "flag": 5,
                "preSell": false
              }
            }
          ],
          "relatedInfo": null,
          "videoUserLiveInfo": null,
          "vid": "9A8B40A9186DE952527CC506D0C3A4A3",
          "durationms": 179285,
          "playTime": 1865445,
          "praisedCount": 12763,
          "praised": false,
          "subscribed": false
        }
      },
      {
        "type": 1,
        "displayed": false,
        "alg": "onlineHotGroup",
        "extAlg": null,
        "data": {
          "alg": "onlineHotGroup",
          "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
          "threadId": "R_VI_62_F7558B2583FD0EEAC892F08D1F2D4138",
          "coverUrl": "https://p1.music.126.net/zrtB1XWn8EGEbLFpg2SJzw==/109951163572833186.jpg",
          "height": 720,
          "width": 1280,
          "title": "云朵 石头合唱《雨花石》掀起掌声无数！",
          "description": "云朵 石头合唱《雨花石》掀起掌声无数！[强]",
          "commentCount": 282,
          "shareCount": 2551,
          "resolutions": [
            {
              "resolution": 240,
              "size": 23012884
            },
            {
              "resolution": 480,
              "size": 32877291
            },
            {
              "resolution": 720,
              "size": 52663136
            }
          ],
          "creator": {
            "defaultAvatar": false,
            "province": 440000,
            "authStatus": 0,
            "followed": false,
            "avatarUrl": "http://p1.music.126.net/61JU8PofXDULCCXxUBvlcA==/109951165016677678.jpg",
            "accountStatus": 0,
            "gender": 0,
            "city": 440100,
            "birthday": -2209017600000,
            "userId": 583316949,
            "userType": 0,
            "nickname": "凝神的优雅挥洒的美",
            "signature": "",
            "description": "",
            "detailDescription": "",
            "avatarImgId": 109951165016677680,
            "backgroundImgId": 109951164952672780,
            "backgroundUrl": "http://p1.music.126.net/3y09Hy4lriR9b-ed2IxmjQ==/109951164952672779.jpg",
            "authority": 0,
            "mutual": false,
            "expertTags": null,
            "experts": null,
            "djStatus": 0,
            "vipType": 0,
            "remarkName": null,
            "backgroundImgIdStr": "109951164952672779",
            "avatarImgIdStr": "109951165016677678"
          },
          "urlInfo": {
            "id": "F7558B2583FD0EEAC892F08D1F2D4138",
            "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/CEmxRGqJ_128516030_shd.mp4?ts=1636387077&rid=02648776A9D33D70D040C82E128F8F4B&rl=3&rs=hicRhisOwQDiAdLxnSBoldeuSeOBfXgX&sign=a5e2c74125df980fdac6a1b576f58d18&ext=YfDbJSkjRHA1vAgh%2BD0WNwV2JWebj2KtExWltRZNHp6u%2FJB2BcS75ZKGSWm4JwjuGpIgDhLXzFElSj2Mn3dxUcwifrlKrWEEkajI1O6JrLD%2BpvV%2B6sXVz7E9w5%2F0ueoCLvWJjXPhxfYPtO1x7zJFMf3jQr%2FiT0K6Ty4SvoY5wjmTTuRBCqLB7hFDedPKU8LtUSsoQXUJFw0n%2BbJeCkN6sh%2B6g7TfMXuZBpGVwu6Lygp5GIh%2FEY%2Bi%2BmB2mJOcHsar",
            "size": 52663136,
            "validityTime": 1200,
            "needPay": false,
            "payInfo": null,
            "r": 720
          },
          "videoGroup": [
            {
              "id": 58100,
              "name": "现场",
              "alg": null
            },
            {
              "id": 59101,
              "name": "华语现场",
              "alg": null
            },
            {
              "id": 1100,
              "name": "音乐现场",
              "alg": null
            },
            {
              "id": 5100,
              "name": "音乐",
              "alg": null
            },
            {
              "id": 15136,
              "name": "怀旧",
              "alg": null
            },
            {
              "id": 14137,
              "name": "感动",
              "alg": null
            },
            {
              "id": 25116,
              "name": "演出信息",
              "alg": null
            }
          ],
          "previewUrl": null,
          "previewDurationms": 0,
          "hasRelatedGameAd": false,
          "markTypes": null,
          "relateSong": [
            {
              "name": "雨花石(独唱版)",
              "id": 30621883,
              "pst": 0,
              "t": 0,
              "ar": [
                {
                  "id": 5084,
                  "name": "石头",
                  "tns": [],
                  "alias": []
                }
              ],
              "alia": [],
              "pop": 95,
              "st": 0,
              "rt": null,
              "fee": 0,
              "v": 3,
              "crbt": null,
              "cf": "",
              "al": {
                "id": 3104116,
                "name": "雨花石",
                "picUrl": "http://p3.music.126.net/LAz9IoKCkezRidE4IFDHKQ==/7758154045798476.jpg",
                "tns": [],
                "pic": 7758154045798476
              },
              "dt": 335908,
              "h": {
                "br": 320000,
                "fid": 0,
                "size": 13439494,
                "vd": -2.48
              },
              "m": {
                "br": 160000,
                "fid": 0,
                "size": 6720279,
                "vd": -2.05
              },
              "l": {
                "br": 96000,
                "fid": 0,
                "size": 4032592,
                "vd": -2.06
              },
              "a": null,
              "cd": "1",
              "no": 1,
              "rtUrl": null,
              "ftype": 0,
              "rtUrls": [],
              "djId": 0,
              "copyright": 2,
              "s_id": 0,
              "rtype": 0,
              "rurl": null,
              "mst": 9,
              "cp": 0,
              "mv": 0,
              "publishTime": 1423929600007,
              "privilege": {
                "id": 30621883,
                "fee": 0,
                "payed": 0,
                "st": 0,
                "pl": 320000,
                "dl": 320000,
                "sp": 7,
                "cp": 1,
                "subp": 1,
                "cs": false,
                "maxbr": 320000,
                "fl": 320000,
                "toast": false,
                "flag": 128,
                "preSell": false
              }
            }
          ],
          "relatedInfo": null,
          "videoUserLiveInfo": null,
          "vid": "F7558B2583FD0EEAC892F08D1F2D4138",
          "durationms": 196022,
          "playTime": 1119099,
          "praisedCount": 3880,
          "praised": false,
          "subscribed": false
        }
      },
      {
        "type": 1,
        "displayed": false,
        "alg": "onlineHotGroup",
        "extAlg": null,
        "data": {
          "alg": "onlineHotGroup",
          "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
          "threadId": "R_VI_62_E4EC4A75AB2E37978E5CE44BEEABD3E6",
          "coverUrl": "https://p1.music.126.net/dEmYWprWxFk7wnwimtBJ2A==/109951163698823249.jpg",
          "height": 720,
          "width": 1280,
          "title": "易烊千玺18岁生日会 浪漫演绎《舒适圈》",
          "description": "易烊千玺18岁生日会 浪漫演绎《舒适圈》",
          "commentCount": 65,
          "shareCount": 228,
          "resolutions": [
            {
              "resolution": 240,
              "size": 19757877
            },
            {
              "resolution": 480,
              "size": 31837172
            },
            {
              "resolution": 720,
              "size": 44128658
            }
          ],
          "creator": {
            "defaultAvatar": false,
            "province": 110000,
            "authStatus": 0,
            "followed": false,
            "avatarUrl": "http://p1.music.126.net/7Z6rYNbcZLl4X9e3TWpWzg==/109951166499729724.jpg",
            "accountStatus": 0,
            "gender": 1,
            "city": 110101,
            "birthday": 640582906223,
            "userId": 555304231,
            "userType": 207,
            "nickname": "娱玖爷",
            "signature": "娱玖爷，明星八卦！娱乐圈精选优秀资源！好音乐分享！【微博同名】中华小曲库就是我！•_•. 商演合作，新专辑推广请私信！",
            "description": "",
            "detailDescription": "",
            "avatarImgId": 109951166499729730,
            "backgroundImgId": 109951165395722990,
            "backgroundUrl": "http://p1.music.126.net/LulOmlCSpzNQKI9xmJYIcg==/109951165395722990.jpg",
            "authority": 0,
            "mutual": false,
            "expertTags": null,
            "experts": {
              "1": "音乐视频达人",
              "2": "生活图文达人"
            },
            "djStatus": 10,
            "vipType": 11,
            "remarkName": null,
            "backgroundImgIdStr": "109951165395722990",
            "avatarImgIdStr": "109951166499729724"
          },
          "urlInfo": {
            "id": "E4EC4A75AB2E37978E5CE44BEEABD3E6",
            "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/kHFHU4GC_2158955439_shd.mp4?ts=1636387077&rid=02648776A9D33D70D040C82E128F8F4B&rl=3&rs=EworGUmearDtNlITTztFfLsHEFhpiKsI&sign=07380582edeb8fe615727630e94cf899&ext=YfDbJSkjRHA1vAgh%2BD0WNwV2JWebj2KtExWltRZNHp6u%2FJB2BcS75ZKGSWm4JwjuGpIgDhLXzFElSj2Mn3dxUcwifrlKrWEEkajI1O6JrLD%2BpvV%2B6sXVz7E9w5%2F0ueoCLvWJjXPhxfYPtO1x7zJFMf3jQr%2FiT0K6Ty4SvoY5wjmTTuRBCqLB7hFDedPKU8LtUSsoQXUJFw0n%2BbJeCkN6sh%2B6g7TfMXuZBpGVwu6Lygp5GIh%2FEY%2Bi%2BmB2mJOcHsar",
            "size": 44128658,
            "validityTime": 1200,
            "needPay": false,
            "payInfo": null,
            "r": 720
          },
          "videoGroup": [
            {
              "id": 58100,
              "name": "现场",
              "alg": null
            },
            {
              "id": 59101,
              "name": "华语现场",
              "alg": null
            },
            {
              "id": 57108,
              "name": "流行现场",
              "alg": null
            },
            {
              "id": 59108,
              "name": "巡演现场",
              "alg": null
            },
            {
              "id": 11137,
              "name": "TFBOYS",
              "alg": null
            },
            {
              "id": 1100,
              "name": "音乐现场",
              "alg": null
            },
            {
              "id": 5100,
              "name": "音乐",
              "alg": null
            },
            {
              "id": 25124,
              "name": "易烊千玺",
              "alg": null
            }
          ],
          "previewUrl": null,
          "previewDurationms": 0,
          "hasRelatedGameAd": false,
          "markTypes": null,
          "relateSong": [],
          "relatedInfo": null,
          "videoUserLiveInfo": null,
          "vid": "E4EC4A75AB2E37978E5CE44BEEABD3E6",
          "durationms": 237633,
          "playTime": 110683,
          "praisedCount": 1281,
          "praised": false,
          "subscribed": false
        }
      },
      {
        "type": 1,
        "displayed": false,
        "alg": "onlineHotGroup",
        "extAlg": null,
        "data": {
          "alg": "onlineHotGroup",
          "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
          "threadId": "R_VI_62_AD700DA249F2711E4E5B982F4CD2E532",
          "coverUrl": "https://p1.music.126.net/xjA_NjU3eiy0oVjebNJf-g==/109951163894397478.jpg",
          "height": 720,
          "width": 1280,
          "title": "当《极乐净土》遇上炮姐的经典，摩擦出不一样的火花",
          "description": null,
          "commentCount": 331,
          "shareCount": 354,
          "resolutions": [
            {
              "resolution": 240,
              "size": 25831256
            },
            {
              "resolution": 480,
              "size": 40143007
            },
            {
              "resolution": 720,
              "size": 53732682
            }
          ],
          "creator": {
            "defaultAvatar": false,
            "province": 110000,
            "authStatus": 0,
            "followed": false,
            "avatarUrl": "http://p1.music.126.net/kBJV7fuExIZCZlm77Y8pLA==/109951163359784378.jpg",
            "accountStatus": 0,
            "gender": 0,
            "city": 110101,
            "birthday": -2209017600000,
            "userId": 1471157370,
            "userType": 0,
            "nickname": "金曲音乐厅",
            "signature": "",
            "description": "",
            "detailDescription": "",
            "avatarImgId": 109951163359784380,
            "backgroundImgId": 109951162868128400,
            "backgroundUrl": "http://p1.music.126.net/2zSNIqTcpHL2jIvU6hG0EA==/109951162868128395.jpg",
            "authority": 0,
            "mutual": false,
            "expertTags": null,
            "experts": {
              "1": "泛生活视频达人"
            },
            "djStatus": 0,
            "vipType": 0,
            "remarkName": null,
            "backgroundImgIdStr": "109951162868128395",
            "avatarImgIdStr": "109951163359784378"
          },
          "urlInfo": {
            "id": "AD700DA249F2711E4E5B982F4CD2E532",
            "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/FbebEbUh_2343255924_shd.mp4?ts=1636387077&rid=02648776A9D33D70D040C82E128F8F4B&rl=3&rs=ETEnEkaKRPfnzhnGwNrqUVCMRvFlPEku&sign=0ebf24520adce4e250bc32db4199ee8e&ext=YfDbJSkjRHA1vAgh%2BD0WNwV2JWebj2KtExWltRZNHp6u%2FJB2BcS75ZKGSWm4JwjuGpIgDhLXzFElSj2Mn3dxUcwifrlKrWEEkajI1O6JrLD%2BpvV%2B6sXVz7E9w5%2F0ueoCLvWJjXPhxfYPtO1x7zJFMf3jQr%2FiT0K6Ty4SvoY5wjmTTuRBCqLB7hFDedPKU8LtUSsoQXUJFw0n%2BbJeCkN6sh%2B6g7TfMXuZBpGVwu6Lygp5GIh%2FEY%2Bi%2BmB2mJOcHsar",
            "size": 53732682,
            "validityTime": 1200,
            "needPay": false,
            "payInfo": null,
            "r": 720
          },
          "videoGroup": [
            {
              "id": 58100,
              "name": "现场",
              "alg": null
            },
            {
              "id": 1101,
              "name": "舞蹈",
              "alg": null
            },
            {
              "id": 9102,
              "name": "演唱会",
              "alg": null
            },
            {
              "id": 60101,
              "name": "日语现场",
              "alg": null
            },
            {
              "id": 57108,
              "name": "流行现场",
              "alg": null
            },
            {
              "id": 3110,
              "name": "宅舞",
              "alg": null
            },
            {
              "id": 1100,
              "name": "音乐现场",
              "alg": null
            },
            {
              "id": 5100,
              "name": "音乐",
              "alg": null
            }
          ],
          "previewUrl": null,
          "previewDurationms": 0,
          "hasRelatedGameAd": false,
          "markTypes": null,
          "relateSong": [],
          "relatedInfo": null,
          "videoUserLiveInfo": null,
          "vid": "AD700DA249F2711E4E5B982F4CD2E532",
          "durationms": 193957,
          "playTime": 950590,
          "praisedCount": 3465,
          "praised": false,
          "subscribed": false
        }
      },
      {
        "type": 1,
        "displayed": false,
        "alg": "onlineHotGroup",
        "extAlg": null,
        "data": {
          "alg": "onlineHotGroup",
          "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
          "threadId": "R_VI_62_A32E3F5021F8E7922B568643109EF08D",
          "coverUrl": "https://p1.music.126.net/aRjspNLvbnHkKcVQv0om4Q==/109951164045021886.jpg",
          "height": 1080,
          "width": 1920,
          "title": "190502 TWICE《FANCY》",
          "description": "190502 MCD #TWICE#《FANCY》",
          "commentCount": 59,
          "shareCount": 68,
          "resolutions": [
            {
              "resolution": 240,
              "size": 70249631
            },
            {
              "resolution": 480,
              "size": 126325710
            },
            {
              "resolution": 720,
              "size": 200883847
            },
            {
              "resolution": 1080,
              "size": 298386321
            }
          ],
          "creator": {
            "defaultAvatar": false,
            "province": 510000,
            "authStatus": 0,
            "followed": false,
            "avatarUrl": "http://p1.music.126.net/yLXSZ6aE7Y0vrOlCGkelrw==/109951166551339160.jpg",
            "accountStatus": 0,
            "gender": 1,
            "city": 510100,
            "birthday": 966334566923,
            "userId": 418727494,
            "userType": 207,
            "nickname": "日落大道的火星说",
            "signature": "还没填写自我介绍",
            "description": "",
            "detailDescription": "",
            "avatarImgId": 109951166551339170,
            "backgroundImgId": 109951166551863070,
            "backgroundUrl": "http://p1.music.126.net/AyWvZypJ4hCEj2uUd3fTbA==/109951166551863077.jpg",
            "authority": 0,
            "mutual": false,
            "expertTags": null,
            "experts": {
              "1": "音乐视频达人",
              "2": "韩语音乐|现场资讯达人"
            },
            "djStatus": 10,
            "vipType": 0,
            "remarkName": null,
            "backgroundImgIdStr": "109951166551863077",
            "avatarImgIdStr": "109951166551339160"
          },
          "urlInfo": {
            "id": "A32E3F5021F8E7922B568643109EF08D",
            "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/aAIkWXrH_2479341065_uhd.mp4?ts=1636387077&rid=02648776A9D33D70D040C82E128F8F4B&rl=3&rs=FbmdcRtRKaFhTCasIJwchxJMndtRFgzS&sign=186aa896b8820b5044606e511a680c7d&ext=YfDbJSkjRHA1vAgh%2BD0WNwV2JWebj2KtExWltRZNHp6u%2FJB2BcS75ZKGSWm4JwjuGpIgDhLXzFElSj2Mn3dxUcwifrlKrWEEkajI1O6JrLD%2BpvV%2B6sXVz7E9w5%2F0ueoCLvWJjXPhxfYPtO1x7zJFMf3jQr%2FiT0K6Ty4SvoY5wjmTTuRBCqLB7hFDedPKU8LtUSsoQXUJFw0n%2BbJeCkN6sh%2B6g7TfMXuZBpGVwu6Lygp5GIh%2FEY%2Bi%2BmB2mJOcHsar",
            "size": 298386321,
            "validityTime": 1200,
            "needPay": false,
            "payInfo": null,
            "r": 1080
          },
          "videoGroup": [
            {
              "id": 58100,
              "name": "现场",
              "alg": null
            },
            {
              "id": 57107,
              "name": "韩语现场",
              "alg": null
            },
            {
              "id": 57108,
              "name": "流行现场",
              "alg": null
            },
            {
              "id": 59108,
              "name": "巡演现场",
              "alg": null
            },
            {
              "id": 1100,
              "name": "音乐现场",
              "alg": null
            },
            {
              "id": 5100,
              "name": "音乐",
              "alg": null
            },
            {
              "id": 25137,
              "name": "音乐资讯",
              "alg": null
            }
          ],
          "previewUrl": null,
          "previewDurationms": 0,
          "hasRelatedGameAd": false,
          "markTypes": null,
          "relateSong": [],
          "relatedInfo": null,
          "videoUserLiveInfo": null,
          "vid": "A32E3F5021F8E7922B568643109EF08D",
          "durationms": 221844,
          "playTime": 183836,
          "praisedCount": 1102,
          "praised": false,
          "subscribed": false
        }
      },
      {
        "type": 1,
        "displayed": false,
        "alg": "onlineHotGroup",
        "extAlg": null,
        "data": {
          "alg": "onlineHotGroup",
          "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
          "threadId": "R_VI_62_7C3000533D067DFEBD37C736BC24D059",
          "coverUrl": "https://p1.music.126.net/zyhndrh4Y7n_71TTEQkMsQ==/109951163455271833.jpg",
          "height": 1080,
          "width": 1920,
          "title": "迈克尔·杰克逊《Earth Song》神级现场，最后直接撕衣服",
          "description": "超震撼！迈克尔·杰克逊《Earth Song》神级现场，最后直接撕开衣服！",
          "commentCount": 204,
          "shareCount": 249,
          "resolutions": [
            {
              "resolution": 240,
              "size": 36576523
            },
            {
              "resolution": 480,
              "size": 62669934
            },
            {
              "resolution": 720,
              "size": 84323564
            },
            {
              "resolution": 1080,
              "size": 133787504
            }
          ],
          "creator": {
            "defaultAvatar": false,
            "province": 340000,
            "authStatus": 0,
            "followed": false,
            "avatarUrl": "http://p1.music.126.net/C6VID_CReqmt8ETsUWaYTQ==/18499283139231828.jpg",
            "accountStatus": 0,
            "gender": 0,
            "city": 340100,
            "birthday": -2209017600000,
            "userId": 479954154,
            "userType": 207,
            "nickname": "音乐诊疗室",
            "signature": "当我坐在那架破旧古钢琴旁边的时候，我对最幸福的国王也不羡慕。（合作推广请私信，或者+V信：mjs927721）",
            "description": "",
            "detailDescription": "",
            "avatarImgId": 18499283139231828,
            "backgroundImgId": 1364493978647983,
            "backgroundUrl": "http://p1.music.126.net/i4J_uvH-pb4sYMsh4fgQAA==/1364493978647983.jpg",
            "authority": 0,
            "mutual": false,
            "expertTags": null,
            "experts": {
              "1": "音乐视频达人",
              "2": "音乐资讯达人"
            },
            "djStatus": 0,
            "vipType": 0,
            "remarkName": null,
            "backgroundImgIdStr": "1364493978647983",
            "avatarImgIdStr": "18499283139231828"
          },
          "urlInfo": {
            "id": "7C3000533D067DFEBD37C736BC24D059",
            "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/cAfiy4nM_1869296406_uhd.mp4?ts=1636387077&rid=02648776A9D33D70D040C82E128F8F4B&rl=3&rs=YQcUqUfePogpfpVAgxPEEEtZYLfHGlwS&sign=d42306116af80a0fc06e56721efbb7b1&ext=YfDbJSkjRHA1vAgh%2BD0WNwV2JWebj2KtExWltRZNHp6u%2FJB2BcS75ZKGSWm4JwjuGpIgDhLXzFElSj2Mn3dxUcwifrlKrWEEkajI1O6JrLD%2BpvV%2B6sXVz7E9w5%2F0ueoCLvWJjXPhxfYPtO1x7zJFMf3jQr%2FiT0K6Ty4SvoY5wjmTTuRBCqLB7hFDedPKU8LtUSsoQXUJFw0n%2BbJeCkN6sh%2B6g7TfMXuZBpGVwu6Lygp5GIh%2FEY%2Bi%2BmB2mJOcHsar",
            "size": 133787504,
            "validityTime": 1200,
            "needPay": false,
            "payInfo": null,
            "r": 1080
          },
          "videoGroup": [
            {
              "id": 58100,
              "name": "现场",
              "alg": null
            },
            {
              "id": 57106,
              "name": "欧美现场",
              "alg": null
            },
            {
              "id": 57108,
              "name": "流行现场",
              "alg": null
            },
            {
              "id": 59108,
              "name": "巡演现场",
              "alg": null
            },
            {
              "id": 1100,
              "name": "音乐现场",
              "alg": null
            },
            {
              "id": 5100,
              "name": "音乐",
              "alg": null
            }
          ],
          "previewUrl": null,
          "previewDurationms": 0,
          "hasRelatedGameAd": false,
          "markTypes": null,
          "relateSong": [
            {
              "name": "Earth Song",
              "id": 1698432,
              "pst": 0,
              "t": 0,
              "ar": [
                {
                  "id": 38853,
                  "name": "Michael Jackson",
                  "tns": [],
                  "alias": []
                }
              ],
              "alia": [],
              "pop": 100,
              "st": 0,
              "rt": "600902000006888017",
              "fee": 8,
              "v": 126,
              "crbt": null,
              "cf": "",
              "al": {
                "id": 172259,
                "name": "HIStory: Past, Present and Future, Book I",
                "picUrl": "http://p3.music.126.net/GtZLLolNwCn07Ke-HZxX1Q==/109951165994661423.jpg",
                "tns": [],
                "pic_str": "109951165994661423",
                "pic": 109951165994661420
              },
              "dt": 406099,
              "h": {
                "br": 320001,
                "fid": 0,
                "size": 16244027,
                "vd": -51870
              },
              "m": {
                "br": 192001,
                "fid": 0,
                "size": 9746434,
                "vd": -49512
              },
              "l": {
                "br": 128001,
                "fid": 0,
                "size": 6497637,
                "vd": -47922
              },
              "a": null,
              "cd": "2",
              "no": 5,
              "rtUrl": null,
              "ftype": 0,
              "rtUrls": [],
              "djId": 0,
              "copyright": 1,
              "s_id": 0,
              "rtype": 0,
              "rurl": null,
              "mst": 9,
              "cp": 7001,
              "mv": 0,
              "publishTime": 1194883200000,
              "privilege": {
                "id": 1698432,
                "fee": 8,
                "payed": 0,
                "st": 0,
                "pl": 128000,
                "dl": 0,
                "sp": 7,
                "cp": 1,
                "subp": 1,
                "cs": false,
                "maxbr": 320000,
                "fl": 128000,
                "toast": false,
                "flag": 4,
                "preSell": false
              }
            }
          ],
          "relatedInfo": null,
          "videoUserLiveInfo": null,
          "vid": "7C3000533D067DFEBD37C736BC24D059",
          "durationms": 291594,
          "playTime": 161217,
          "praisedCount": 1130,
          "praised": false,
          "subscribed": false
        }
      },
      {
        "type": 1,
        "displayed": false,
        "alg": "onlineHotGroup",
        "extAlg": null,
        "data": {
          "alg": "onlineHotGroup",
          "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
          "threadId": "R_VI_62_EECADCC2E8EE86EF22DFEE61E5152C0D",
          "coverUrl": "https://p1.music.126.net/bE4uB8PZf5AKVuFm_3vrVw==/109951163574072939.jpg",
          "height": 1080,
          "width": 1920,
          "title": "BIGBANG - BANG BANG BANG，现场炸裂！",
          "description": "要有多强大...才能承受这么嗨的现场！！",
          "commentCount": 603,
          "shareCount": 1768,
          "resolutions": [
            {
              "resolution": 240,
              "size": 42512913
            },
            {
              "resolution": 480,
              "size": 75433779
            },
            {
              "resolution": 720,
              "size": 111236461
            },
            {
              "resolution": 1080,
              "size": 176533817
            }
          ],
          "creator": {
            "defaultAvatar": false,
            "province": 110000,
            "authStatus": 0,
            "followed": false,
            "avatarUrl": "http://p1.music.126.net/M2gId22LRR0vpWWSDIQvdQ==/109951163458813116.jpg",
            "accountStatus": 0,
            "gender": 2,
            "city": 110101,
            "birthday": 916329600000,
            "userId": 1344968972,
            "userType": 0,
            "nickname": "小兔哦哦安利酱",
            "signature": "喜欢音乐，喜欢现场，也喜欢分享，准备好接受安利了吗~",
            "description": "",
            "detailDescription": "",
            "avatarImgId": 109951163458813120,
            "backgroundImgId": 109951162868126480,
            "backgroundUrl": "http://p1.music.126.net/_f8R60U9mZ42sSNvdPn2sQ==/109951162868126486.jpg",
            "authority": 0,
            "mutual": false,
            "expertTags": null,
            "experts": {
              "1": "音乐视频达人"
            },
            "djStatus": 0,
            "vipType": 0,
            "remarkName": null,
            "backgroundImgIdStr": "109951162868126486",
            "avatarImgIdStr": "109951163458813116"
          },
          "urlInfo": {
            "id": "EECADCC2E8EE86EF22DFEE61E5152C0D",
            "url": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/PQsSiy4V_1835915135_uhd.mp4?ts=1636387077&rid=02648776A9D33D70D040C82E128F8F4B&rl=3&rs=gxgrDsLVUUJycWCcIBZFkvdnzcnXAoFQ&sign=3568e6cb43dc37864772d3208abb483c&ext=YfDbJSkjRHA1vAgh%2BD0WNwV2JWebj2KtExWltRZNHp6u%2FJB2BcS75ZKGSWm4JwjuGpIgDhLXzFElSj2Mn3dxUcwifrlKrWEEkajI1O6JrLD%2BpvV%2B6sXVz7E9w5%2F0ueoCLvWJjXPhxfYPtO1x7zJFMf3jQr%2FiT0K6Ty4SvoY5wjmTTuRBCqLB7hFDedPKU8LtUSsoQXUJFw0n%2BbJeCkN6sh%2B6g7TfMXuZBpGVwu6Lygp5GIh%2FEY%2Bi%2BmB2mJOcHsar",
            "size": 176533817,
            "validityTime": 1200,
            "needPay": false,
            "payInfo": null,
            "r": 1080
          },
          "videoGroup": [
            {
              "id": 58100,
              "name": "现场",
              "alg": null
            },
            {
              "id": 57107,
              "name": "韩语现场",
              "alg": null
            },
            {
              "id": 57108,
              "name": "流行现场",
              "alg": null
            },
            {
              "id": 59108,
              "name": "巡演现场",
              "alg": null
            },
            {
              "id": 10114,
              "name": "BIGBANG",
              "alg": null
            },
            {
              "id": 1100,
              "name": "音乐现场",
              "alg": null
            },
            {
              "id": 5100,
              "name": "音乐",
              "alg": null
            }
          ],
          "previewUrl": null,
          "previewDurationms": 0,
          "hasRelatedGameAd": false,
          "markTypes": [
            101,
            111
          ],
          "relateSong": [
            {
              "name": "BANG BANG BANG [BIGBANG JAPAN DOME TOUR 2017 -LAST DANCE-]",
              "id": 544000776,
              "pst": 0,
              "t": 0,
              "ar": [
                {
                  "id": 126339,
                  "name": "BIGBANG",
                  "tns": [],
                  "alias": []
                }
              ],
              "alia": [],
              "pop": 80,
              "st": 0,
              "rt": null,
              "fee": 8,
              "v": 5,
              "crbt": null,
              "cf": "",
              "al": {
                "id": 37888128,
                "name": "BIGBANG JAPAN DOME TOUR 2017 -LAST DANCE-",
                "picUrl": "http://p4.music.126.net/zyAfNZxKyStckW2HFJExFA==/109951163186109980.jpg",
                "tns": [],
                "pic_str": "109951163186109980",
                "pic": 109951163186109980
              },
              "dt": 231453,
              "h": {
                "br": 320000,
                "fid": 0,
                "size": 9260974,
                "vd": -18400
              },
              "m": {
                "br": 192000,
                "fid": 0,
                "size": 5556602,
                "vd": -16000
              },
              "l": {
                "br": 128000,
                "fid": 0,
                "size": 3704416,
                "vd": -14500
              },
              "a": null,
              "cd": "1",
              "no": 20,
              "rtUrl": null,
              "ftype": 0,
              "rtUrls": [],
              "djId": 0,
              "copyright": 0,
              "s_id": 0,
              "rtype": 0,
              "rurl": null,
              "mst": 9,
              "cp": 457010,
              "mv": 0,
              "publishTime": 1520956800007,
              "privilege": {
                "id": 544000776,
                "fee": 8,
                "payed": 0,
                "st": 0,
                "pl": 128000,
                "dl": 0,
                "sp": 7,
                "cp": 1,
                "subp": 1,
                "cs": false,
                "maxbr": 999000,
                "fl": 128000,
                "toast": false,
                "flag": 261,
                "preSell": false
              }
            }
          ],
          "relatedInfo": null,
          "videoUserLiveInfo": null,
          "vid": "EECADCC2E8EE86EF22DFEE61E5152C0D",
          "durationms": 245691,
          "playTime": 2236055,
          "praisedCount": 15047,
          "praised": false,
          "subscribed": false
        }
      },
      {
        "type": 1,
        "displayed": false,
        "alg": "onlineHotGroup",
        "extAlg": null,
        "data": {
          "alg": "onlineHotGroup",
          "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
          "threadId": "R_VI_62_C701F554DF89FDA5639BE2064178EB66",
          "coverUrl": "https://p1.music.126.net/DyudlB9YnecgYpcd_CIbXA==/109951165156138686.jpg",
          "height": 540,
          "width": 960,
          "title": "第5期小组舞台:丁程鑫刘耀文、张真源宋亚轩《说散就散》",
          "description": null,
          "commentCount": 163,
          "shareCount": 494,
          "resolutions": [
            {
              "resolution": 240,
              "size": 28682619
            },
            {
              "resolution": 480,
              "size": 36506700
            }
          ],
          "creator": {
            "defaultAvatar": false,
            "province": 350000,
            "authStatus": 0,
            "followed": false,
            "avatarUrl": "http://p1.music.126.net/h7FQvsrSo-hXen9681WTtw==/109951165876982723.jpg",
            "accountStatus": 0,
            "gender": 2,
            "city": 350200,
            "birthday": 887472000000,
            "userId": 517873740,
            "userType": 0,
            "nickname": "不加糖的KIKO",
            "signature": "",
            "description": "",
            "detailDescription": "",
            "avatarImgId": 109951165876982720,
            "backgroundImgId": 109951165399791520,
            "backgroundUrl": "http://p1.music.126.net/beNW-KebhqYu7zNP7twglw==/109951165399791516.jpg",
            "authority": 0,
            "mutual": false,
            "expertTags": null,
            "experts": null,
            "djStatus": 0,
            "vipType": 0,
            "remarkName": null,
            "backgroundImgIdStr": "109951165399791516",
            "avatarImgIdStr": "109951165876982723"
          },
          "urlInfo": {
            "id": "C701F554DF89FDA5639BE2064178EB66",
            "url": "http://vodkgeyttp9.vod.126.net/cloudmusic/tva8PdZW_3064409916_hd.mp4?ts=1636387077&rid=02648776A9D33D70D040C82E128F8F4B&rl=3&rs=OyWueMyVaYWmMvGqPVohPWNzBwrVbwtb&sign=a5b246bc109ee0038b5030906cb117ff&ext=YfDbJSkjRHA1vAgh%2BD0WNwV2JWebj2KtExWltRZNHp6u%2FJB2BcS75ZKGSWm4JwjuGpIgDhLXzFElSj2Mn3dxUcwifrlKrWEEkajI1O6JrLD%2BpvV%2B6sXVz7E9w5%2F0ueoCLvWJjXPhxfYPtO1x7zJFMf3jQr%2FiT0K6Ty4SvoY5wjmTTuRBCqLB7hFDedPKU8LtUSsoQXUJFw0n%2BbJeCkN6sh%2B6g7TfMXuZBpGVwu6Lygp5GIh%2FEY%2Bi%2BmB2mJOcHsar",
            "size": 36506700,
            "validityTime": 1200,
            "needPay": false,
            "payInfo": null,
            "r": 480
          },
          "videoGroup": [
            {
              "id": 58100,
              "name": "现场",
              "alg": null
            },
            {
              "id": 59101,
              "name": "华语现场",
              "alg": null
            },
            {
              "id": 59108,
              "name": "巡演现场",
              "alg": null
            },
            {
              "id": 1100,
              "name": "音乐现场",
              "alg": null
            },
            {
              "id": 5100,
              "name": "音乐",
              "alg": null
            }
          ],
          "previewUrl": null,
          "previewDurationms": 0,
          "hasRelatedGameAd": false,
          "markTypes": null,
          "relateSong": [],
          "relatedInfo": null,
          "videoUserLiveInfo": null,
          "vid": "C701F554DF89FDA5639BE2064178EB66",
          "durationms": 223168,
          "playTime": 239065,
          "praisedCount": 6064,
          "praised": false,
          "subscribed": false
        }
      }
    ]
    let videoList = this.data.videoList
    videoList.push(...newVideoList)
    this.setData({
      videoList
    })
  },
  toSearch(){
    wx.navigateTo({
      url: '/pages/search/search',
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    console.log('下拉刷新')
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    console.log('上拉加载更多')
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function ({from}) {
    console.log(from)
    if(from==='menu'){
      return {
        title: '来自GQ小程序主页面分享',
        path: '/pages/video/video',
        imageUrl: '/static/images/self.jpg'
      }
    }else{
      return {
        title: '来自GQ按钮单个视频分享',
        path: '/pages/video/video',
        imageUrl: '/static/images/self.jpg'
      }
    }
  }
})

